using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableDailyTaskRewardBoxDao:DaoBase<TableDailyTaskRewardBox>
    {
        public override void AddPrimaryIndex(TableDailyTaskRewardBox model)
        {
            cachePrimary[model.boxId.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableDailyTaskRewardBox.txt";
        }

        protected override TableDailyTaskRewardBox ParseRowData(string[] rowData)
        {
            TableDailyTaskRewardBox data = new TableDailyTaskRewardBox();
			data.boxId = rowData [0];

            if (string.IsNullOrEmpty(rowData[1]))
            {
                data.startLevel = 0;
            }
            else
            {
                data.startLevel = int.Parse(rowData[1]);
            }

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.endLevel = 0;
            }
            else
            {
                data.endLevel = int.Parse(rowData[2]);
            }

            if (string.IsNullOrEmpty(rowData[3]))
            {
                data.needScore = 0;
            }
            else
            {
                data.needScore = int.Parse(rowData[3]);
            }
			data.reward = rowData [4];

            return data;
        }



    }

}
